package org.deng.learn.designpattern.abstractfactory;

/**
 * @author DengLibin
 * @Description 形状工厂
 * @Date 2019/2/12 0012 14:44
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    Color getColor(ColorName colorName) {
        return null;
    }

    @Override
    Shape getShape(ShapeName shapeName) {
        switch (shapeName){
            case CIRCLE:
                return new CircleShape();
            case RECTANGLE:
                return new Rectangle();
        }
        throw new RuntimeException("参数不正确");
    }
}
